#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int a = 0;
	int b = 1000;
	int s = 0;
	scanf("%d", &a);
	s = b - a;
	printf("%d\n", s);
	return 0;
}